{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "num 8\n"
     ]
    }
   ],
   "source": [
    "def func(n):\n",
    "    return lambda a: a * n\n",
    "\n",
    "double = func(2)\n",
    "\n",
    "num = double(4)\n",
    "\n",
    "print(f\"num\",num)\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "res:4\n"
     ]
    }
   ],
   "source": [
    "def func2(n:int)->int:\n",
    "    a:int = 2\n",
    "    return n*a\n",
    "\n",
    "res = func2(2)\n",
    "\n",
    "print(f\"res:{res}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class Point:\n",
    "    def __init__(self, x, y):\n",
    "        self.x = x\n",
    "        self.y = y\n",
    "\n",
    "\n",
    "def func3(n: int) -> int:\n",
    "    a: Point = Point(2, 2)\n",
    "    return a.x * n + a.y * n\n",
    "\n",
    "\n",
    "func3(2)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
